from django.contrib import admin

# Register your models here.
from django.contrib import admin
from django.utils.html import format_html

from .models import Person


class PersonAdmin(admin.ModelAdmin):
    list_display = ['card_id', 'name', 'permanent_residence', 'mobile', 'status']

    '''定义哪个字段可以编辑'''
    list_editable = ('status',)

    list_display_links = ('card_id',)

    '''分页：每页10条'''
    list_per_page = 30

    '''搜索框 ^, =, @, None=icontains'''
    search_fields = ['name', 'permanent_residence']

    '''最大条目'''
    list_max_show_all = 200  # default

    '''默认空值'''
    empty_value_display = 'NA'

    '''过滤选项'''
    list_filter = ('status', 'permanent_residence')




# Register your models here.
admin.site.register(Person, PersonAdmin)

# admin.site
admin.AdminSite.site_header = "疫情防控首页"
admin.AdminSite.site_title = "疫情防控管理系统"
